<div class="index coaches">
<h2><?php __('Coaches');?></h2>
<p><?php echo $paginator->counter(array('format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)));?></p>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort(__('Name', true),'Coach.strName');?></th>
	<th><?php echo $paginator->sort(__('User', true),'User.username');?></th>
	<th><?php echo $paginator->sort(__('G', true),'StatisticsCoach.iMatchPlayed');?></th>
	<th><?php echo $paginator->sort(__('W', true),'StatisticsCoach.iWins');?></th>
	<th><?php echo $paginator->sort(__('D', true),'StatisticsCoach.iDraws');?></th>
	<th><?php echo $paginator->sort(__('L', true),'StatisticsCoach.iLoss');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($coaches as $coach):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}

?>
	<tr<?php echo $class;?>>
		<td><?php echo $coach['Coach']['strName']; ?></td>
        <td><?php echo $coach['User']['username']; ?></td>
		<td><?php echo $coach['StatisticsCoach']['iMatchPlayed']; ?></td>
		<td><?php echo $coach['StatisticsCoach']['iWins']; ?></td>
		<td><?php echo $coach['StatisticsCoach']['iDraws']; ?></td>
		<td><?php echo $coach['StatisticsCoach']['iLoss']; ?></td>
		<td class="actions">
			<?php echo $html->link(__('View', true), array('action' => 'view', $coach['Coach']['ID'])); ?>
			<?php echo $html->link(__('Edit', true), array('action' => 'edit', $coach['Coach']['ID'])); ?>
			<?php echo $html->link(__('Delete', true), array('action' => 'delete', $coach['Coach']['ID']), null, sprintf(__('Are you sure you want to delete # %s?', true), $coach['Coach']['ID'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers();?>
	<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('New Coach', true), array('action' => 'add')); ?></li>
		<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
	</ul>
</div>
